/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.hl7.v3.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.hl7.v3.POCDMT000040RegionOfInterestValue;
import org.hl7.v3.V3Package;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>POCDMT000040 Region Of Interest Value</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040RegionOfInterestValueImpl#isUnsorted <em>Unsorted</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class POCDMT000040RegionOfInterestValueImpl extends INT1Impl implements POCDMT000040RegionOfInterestValue {
	/**
	 * The default value of the '{@link #isUnsorted() <em>Unsorted</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #isUnsorted()
	 * @generated
	 * @ordered
	 */
	protected static final boolean UNSORTED_EDEFAULT = false;

	/**
	 * The cached value of the '{@link #isUnsorted() <em>Unsorted</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #isUnsorted()
	 * @generated
	 * @ordered
	 */
	protected boolean unsorted = UNSORTED_EDEFAULT;

	/**
	 * This is true if the Unsorted attribute has been set.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 * @ordered
	 */
	protected boolean unsortedESet;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected POCDMT000040RegionOfInterestValueImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return V3Package.eINSTANCE.getPOCDMT000040RegionOfInterestValue();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean isUnsorted() {
		return unsorted;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setUnsorted(boolean newUnsorted) {
		boolean oldUnsorted = unsorted;
		unsorted = newUnsorted;
		boolean oldUnsortedESet = unsortedESet;
		unsortedESet = true;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.POCDMT000040_REGION_OF_INTEREST_VALUE__UNSORTED, oldUnsorted, unsorted, !oldUnsortedESet));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void unsetUnsorted() {
		boolean oldUnsorted = unsorted;
		boolean oldUnsortedESet = unsortedESet;
		unsorted = UNSORTED_EDEFAULT;
		unsortedESet = false;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.UNSET, V3Package.POCDMT000040_REGION_OF_INTEREST_VALUE__UNSORTED, oldUnsorted, UNSORTED_EDEFAULT, oldUnsortedESet));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean isSetUnsorted() {
		return unsortedESet;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case V3Package.POCDMT000040_REGION_OF_INTEREST_VALUE__UNSORTED:
				return isUnsorted() ? Boolean.TRUE : Boolean.FALSE;
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case V3Package.POCDMT000040_REGION_OF_INTEREST_VALUE__UNSORTED:
				setUnsorted(((Boolean)newValue).booleanValue());
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case V3Package.POCDMT000040_REGION_OF_INTEREST_VALUE__UNSORTED:
				unsetUnsorted();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case V3Package.POCDMT000040_REGION_OF_INTEREST_VALUE__UNSORTED:
				return isSetUnsorted();
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (unsorted: ");
		if (unsortedESet) result.append(unsorted); else result.append("<unset>");
		result.append(')');
		return result.toString();
	}

} //POCDMT000040RegionOfInterestValueImpl
